<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OpenMesh: OpenMesh::IO::_OFFReader_ Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="logo_align.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="rwth_vci_rgb.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OpenMesh
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('a02041.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="a02038.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">OpenMesh::IO::_OFFReader_ Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Implementation of the OFF format reader.  
 <a href="a02041.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00233_source.html">OpenMesh/Core/IO/reader/OFFReader.hh</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for OpenMesh::IO::_OFFReader_:</div>
<div class="dyncontent">
<div class="center"><img src="a02040.png" border="0" usemap="#OpenMesh_1_1IO_1_1__OFFReader___inherit__map" alt="Inheritance graph"/></div>
<map name="OpenMesh_1_1IO_1_1__OFFReader___inherit__map" id="OpenMesh_1_1IO_1_1__OFFReader___inherit__map">
<area shape="rect" id="node2" href="a02033.html" title="Base class for reader modules. " alt="" coords="11,5,197,32"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for OpenMesh::IO::_OFFReader_:</div>
<div class="dyncontent">
<div class="center"><img src="a02039.png" border="0" usemap="#OpenMesh_1_1IO_1_1__OFFReader___coll__map" alt="Collaboration graph"/></div>
<map name="OpenMesh_1_1IO_1_1__OFFReader___coll__map" id="OpenMesh_1_1IO_1_1__OFFReader___coll__map">
<area shape="rect" id="node2" href="a02033.html" title="Base class for reader modules. " alt="" coords="11,5,197,32"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a03ed5cb451f35941a024c3933a3abd0b"><td class="memItemLeft" align="right" valign="top"><a id="a03ed5cb451f35941a024c3933a3abd0b"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a02041.html#a03ed5cb451f35941a024c3933a3abd0b">~_OFFReader_</a> ()</td></tr>
<tr class="memdesc:a03ed5cb451f35941a024c3933a3abd0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a03ed5cb451f35941a024c3933a3abd0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e6980ef7828abfdf39a9c6e6fe4746f"><td class="memItemLeft" align="right" valign="top"><a id="a3e6980ef7828abfdf39a9c6e6fe4746f"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a02041.html#a3e6980ef7828abfdf39a9c6e6fe4746f">get_description</a> () const override</td></tr>
<tr class="memdesc:a3e6980ef7828abfdf39a9c6e6fe4746f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a brief description of the file type that can be parsed. <br /></td></tr>
<tr class="separator:a3e6980ef7828abfdf39a9c6e6fe4746f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad7527069b7ce7f90e5cbbf3102178299"><td class="memItemLeft" align="right" valign="top"><a id="ad7527069b7ce7f90e5cbbf3102178299"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a02041.html#ad7527069b7ce7f90e5cbbf3102178299">get_extensions</a> () const override</td></tr>
<tr class="memdesc:ad7527069b7ce7f90e5cbbf3102178299"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a string with the accepted file extensions separated by a whitespace and in small caps. <br /></td></tr>
<tr class="separator:ad7527069b7ce7f90e5cbbf3102178299"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aedf3c09b198039fd080c83e9bc106fcf"><td class="memItemLeft" align="right" valign="top"><a id="aedf3c09b198039fd080c83e9bc106fcf"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a02041.html#aedf3c09b198039fd080c83e9bc106fcf">get_magic</a> () const override</td></tr>
<tr class="memdesc:aedf3c09b198039fd080c83e9bc106fcf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return magic bits used to determine file format. <br /></td></tr>
<tr class="separator:aedf3c09b198039fd080c83e9bc106fcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a88e2011ca42baa579175f01c6e63121e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a02041.html#a88e2011ca42baa579175f01c6e63121e">read</a> (const std::string &amp;_filename, <a class="el" href="a02017.html">BaseImporter</a> &amp;_bi, <a class="el" href="a02029.html">Options</a> &amp;_opt) override</td></tr>
<tr class="memdesc:a88e2011ca42baa579175f01c6e63121e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a mesh given by a filename.  <a href="#a88e2011ca42baa579175f01c6e63121e">More...</a><br /></td></tr>
<tr class="separator:a88e2011ca42baa579175f01c6e63121e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0204e3fe1867bd1086e6e962f381e0b6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a02041.html#a0204e3fe1867bd1086e6e962f381e0b6">can_u_read</a> (const std::string &amp;_filename) const override</td></tr>
<tr class="memdesc:a0204e3fe1867bd1086e6e962f381e0b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if writer can parse _filename (checks extension).  <a href="#a0204e3fe1867bd1086e6e962f381e0b6">More...</a><br /></td></tr>
<tr class="separator:a0204e3fe1867bd1086e6e962f381e0b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44641981102decac8882009401469af5"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a02041.html#a44641981102decac8882009401469af5">read</a> (std::istream &amp;_in, <a class="el" href="a02017.html">BaseImporter</a> &amp;_bi, <a class="el" href="a02029.html">Options</a> &amp;_opt) override</td></tr>
<tr class="memdesc:a44641981102decac8882009401469af5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads a mesh given by a std::stream.  <a href="#a44641981102decac8882009401469af5">More...</a><br /></td></tr>
<tr class="separator:a44641981102decac8882009401469af5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_a02033"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_a02033')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="a02033.html">OpenMesh::IO::BaseReader</a></td></tr>
<tr class="memitem:affd6cb98cb0883d0afc5edd2067b21fe inherit pub_methods_a02033"><td class="memItemLeft" align="right" valign="top"><a id="affd6cb98cb0883d0afc5edd2067b21fe"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a02033.html#affd6cb98cb0883d0afc5edd2067b21fe">~BaseReader</a> ()</td></tr>
<tr class="memdesc:affd6cb98cb0883d0afc5edd2067b21fe inherit pub_methods_a02033"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:affd6cb98cb0883d0afc5edd2067b21fe inherit pub_methods_a02033"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_a02033"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_a02033')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="a02033.html">OpenMesh::IO::BaseReader</a></td></tr>
<tr class="memitem:a9be6726a28324b1b1af557ff483b4efd inherit pro_methods_a02033"><td class="memItemLeft" align="right" valign="top"><a id="a9be6726a28324b1b1af557ff483b4efd"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>check_extension</b> (const std::string &amp;_fname, const std::string &amp;_ext) const</td></tr>
<tr class="separator:a9be6726a28324b1b1af557ff483b4efd inherit pro_methods_a02033"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implementation of the OFF format reader. </p>
<p>This class is singleton'ed by <a class="el" href="a02617.html" title="A simple singleton template. ">SingletonT</a> to OFFReader.</p>
<p>By passing <a class="el" href="a02029.html" title="Set options for reader/writer modules. ">Options</a> to the read function you can manipulate the reading behavoir. The following options can be set:</p>
<p>VertexNormal VertexColor VertexTexCoord FaceColor ColorAlpha [only when reading binary]</p>
<p>These options define if the corresponding data should be read (if available) or if it should be omitted.</p>
<p>After execution of the read function. The options object contains information about what was actually read.</p>
<p>e.g. if VertexNormal was true when the read function was called, but the file did not contain vertex normals then it is false afterwards.</p>
<p>When reading a binary off with Color Flag in the header it is assumed that all vertices and faces have colors in the format "int int int". If ColorAlpha is set the format "int int int int" is assumed. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a0204e3fe1867bd1086e6e962f381e0b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0204e3fe1867bd1086e6e962f381e0b6">&#9670;&nbsp;</a></span>can_u_read()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool OpenMesh::IO::_OFFReader_::can_u_read </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>_filename</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Returns true if writer can parse _filename (checks extension). </p>
<p>_filename can also provide an extension without a name for a file e.g. _filename == "om" checks, if the reader can read the "om" extension </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">_filename</td><td>complete name of a file or just the extension </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true, if reader can read data with the given extension </dd></dl>

<p>Reimplemented from <a class="el" href="a02033.html#ac507cba601d3c10bbbe4ed376d9f6628">OpenMesh::IO::BaseReader</a>.</p>

</div>
</div>
<a id="a88e2011ca42baa579175f01c6e63121e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88e2011ca42baa579175f01c6e63121e">&#9670;&nbsp;</a></span>read() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool OpenMesh::IO::_OFFReader_::read </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>_filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a02017.html">BaseImporter</a> &amp;&#160;</td>
          <td class="paramname"><em>_bi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a02029.html">Options</a> &amp;&#160;</td>
          <td class="paramname"><em>_opt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reads a mesh given by a filename. </p>
<p>Usually this method opens a stream and passes it to stream read method. Acceptance checks by filename extension can be placed here.</p>
<p><a class="el" href="a02029.html" title="Set options for reader/writer modules. ">Options</a> can be passed via _opt. After execution _opt contains the <a class="el" href="a02029.html" title="Set options for reader/writer modules. ">Options</a> that were available </p>

<p>Implements <a class="el" href="a02033.html#af4a32645528c1bf2043a9259b172f411">OpenMesh::IO::BaseReader</a>.</p>

</div>
</div>
<a id="a44641981102decac8882009401469af5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44641981102decac8882009401469af5">&#9670;&nbsp;</a></span>read() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool OpenMesh::IO::_OFFReader_::read </td>
          <td>(</td>
          <td class="paramtype">std::istream &amp;&#160;</td>
          <td class="paramname"><em>_is</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a02017.html">BaseImporter</a> &amp;&#160;</td>
          <td class="paramname"><em>_bi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a02029.html">Options</a> &amp;&#160;</td>
          <td class="paramname"><em>_opt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reads a mesh given by a std::stream. </p>
<p>This method usually uses the same stream reading method that read uses. <a class="el" href="a02029.html" title="Set options for reader/writer modules. ">Options</a> can be passed via _opt. After execution _opt contains the <a class="el" href="a02029.html" title="Set options for reader/writer modules. ">Options</a> that were available.</p>
<p>Please make sure that if _is is std::ifstream, the correct std::ios_base::openmode flags are set. </p>

<p>Implements <a class="el" href="a02033.html#a0fd4df36decf91cd91a7f363aae56065">OpenMesh::IO::BaseReader</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>OpenMesh/Core/IO/reader/<a class="el" href="a00233_source.html">OFFReader.hh</a></li>
<li>OpenMesh/Core/IO/reader/OFFReader.cc</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<hr>
<address>
<small>
<a href="http://www.rwth-graphics.de" style="text-decoration:none;">
</a>
Project <b>OpenMesh</b>, 
&copy;&nbsp; Computer Graphics Group, RWTH Aachen.
Documentation generated using 
<a class="el" href="http://www.doxygen.org/index.html">
<b>doxygen</b>
</a>.
</small>
</address>
</body>
</html>
